#include <stdio.h>

float product(float*pa, float *pb, int n)
{	   	 	      
    int i;
    float s;
    for (i = 0, s = 0; i < n; i++)
    {	   	 	      
        s = s + (*pa * *pb);
        pa++;
        pb++;
    }
    return s;
}	   	 	      
int main(int argc, char* argv[])
{	   	 	      
    float *pa, *pb, sum;
    int i, n;

    printf("Input n\n");
    scanf("%d", &n);
    pa = (float*) malloc(n * sizeof(float));
    pb = (float*) malloc(n * sizeof(float));
    printf("Input array a\n");
    for (i = 0; i < n; i++)
    {	   	 	      
        scanf("%f", pa);
        pa++;
    }
    printf("Input array b\n");
    for (i = 0; i < n; i++)
    {	   	 	      
        scanf("%f", pb);
        pb++;
    }
    pa = pa - n;
    pb = pb - n;
    sum = product(pa, pb, n);
    printf("\nsum=%f\n", sum);

    return 0;
}